package pt.ist.meic.pava;

import javassist.CtClass;
import javassist.CtMethod;



/**
 * 
 * @author Antonio Massingue
 * @author Joao Matos
 * @author Nuno Santos
 * 
 * This Exception should be thrown when public
 * fields are found in a class annotated with
 * the @Trait annotation
 * 
 */
public class PublicFieldsOnTraitException extends Exception {

	
	
	
	/**
	 * The Serial Version Id
	 */
	private static final long serialVersionUID = 1232733434426739046L;

	
	
	
	/**
	 * The annotated class
	 */
	private CtClass ctClass;
	
	
	
	
	
	
	
	
	/**
	 * Default Constructor
	 */
	public PublicFieldsOnTraitException() {
		super();
	}

	/**
	 * Overloaded Constructor
	 * @param aCtClass - The annotated class
	 */
	public PublicFieldsOnTraitException(CtClass aCtClass){
		super();
		this.ctClass = aCtClass;
	}
	
	
	
	
	
	
	
	
	
	/**
	 * This method prints the detailed message of this exception
	 */
	public void printPublicFieldsOnTraitException() {
		System.err.println("The Trait "+this.ctClass.getName()+" contains public fields");
	}

	
	
	
	
	
	
	
	
	/**
	 * @return the annotated class
	 */
	public CtClass getCtClass() {
		return ctClass;
	}

	/**
	 * @param ctClass the annotated class
	 */
	public void setCtClass(CtClass ctClass) {
		this.ctClass = ctClass;
	}
	
	
	
	
	
	 
}



